package com.xiaoshuidi.cloud.framework.fadada.core.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 账户类型枚举
 */
@Getter
@AllArgsConstructor
public enum IdentTypeEnum {

    ID_NO("0", "身份证号"),
    PASSPORT_NO("1", "护照号"),
    HOME_VISITING_NO("B", "港澳居民来往内地通行证号"),
    TAIWANESE_SYNDROME_NO("C", "台湾居民来往大陆通行证号"),
    ;

    /**
     * 编码
     */
    private final String code;
    /**
     * 名字
     */
    private final String name;

    public static IdentTypeEnum getByCode(String code) {
        return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
    }

}
